#!/usr/local/bin/lua
-- print('hello');
print('hello');

-- sum = 1+...+N
-- not need indent
sum=0
num=1
while num<=100 do
sum=sum+num
num=num+1
end
print('sum=',sum)


-- if else
age=30
male='aa'
if age<19 and sex=='f' then
	print('little girl')
elseif age>20 and sex ~='f' then
	print('men')
else
	print('too young')
end

if(age>1) then
	print('age>1')
end

-- for
sum=0
for i=1,100 do
	sum=sum+i
end
print(sum)


sum=0 -- step=2
for i=1,100,2 do
	sum=sum+i
end
print(sum)


-- until
sum=2
repeat
	sum=sum*2
	print(sum)
until sum>1000
